package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Collect;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作收藏信息相关数据接口
 */
public interface CollectMapper extends BaseMapper<Collect> {

    int updateById(Collect collect);

    Collect selectById(Integer id);

    List<Collect> selectAll(Collect collect);

    @Select("select * from collect where user_id = #{userId} and business_id = #{businessId}")
    Collect selectByUserIdAndBusinessId(@Param("userId") Integer userId, @Param("businessId") Integer businessId);

}